home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / perl5a1.lha / perl5alpha1 / atarist / perldb.diff < prev    next >
Encoding:
Text File  |  1992-08-08  |  5.1 KB  |  183 lines

  1. *** ../../../lib/perldb.pl    Mon Nov 11 10:40:22 1991
  2. --- perldb.pl    Mon May 18 17:00:56 1992
  3. ***************
  4. *** 1,10 ****
  5.   package DB;
  6.   
  7. ! # modified Perl debugger, to be run from Emacs in perldb-mode
  8. ! # Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
  9. ! # Johan Vromans -- upgrade to 4.0 pl 10
  10. ! $header = '$RCSfile: perldb.diff,v $$Revision: 4.1 $$Date: 92/08/07 17:18:44 $';
  11.   #
  12.   # This file is automatically included if you do perl -d.
  13.   # It's probably not useful to include this yourself.
  14. --- 1,6 ----
  15.   package DB;
  16.   
  17. ! $header = '$RCSfile: perldb.diff,v $$Revision: 4.1 $$Date: 92/08/07 17:18:44 $';
  18.   #
  19.   # This file is automatically included if you do perl -d.
  20.   # It's probably not useful to include this yourself.
  21. ***************
  22. *** 14,22 ****
  23.   # have a breakpoint.  It also inserts a do 'perldb.pl' before the first line.
  24.   #
  25.   # $Log:    perldb.diff,v $
  26.   # Revision 4.1  92/08/07  17:18:44  lwall
  27.   # Stage 6 Snapshot
  28.   # 
  29.   # Revision 4.0.1.1  92/06/08  11:50:28  lwall
  30.   # Initial revision
  31.   # 
  32. - # Revision 4.0.1.2  91/11/05  17:55:58  lwall
  33. - # patch11: perldb.pl modified to run within emacs in perldb-mode
  34. - # 
  35.   # Revision 4.0.1.1  91/06/07  11:17:44  lwall
  36.   # patch4: added $^P variable to control calling of perldb routines
  37.   # patch4: debugger sometimes listed wrong number of lines for a statement
  38. --- 10,15 ----
  39. ***************
  40. *** 56,63 ****
  41.   # 
  42.   #
  43.   
  44. ! open(IN, "</dev/tty") || open(IN,  "<&STDIN");    # so we don't dingle stdin
  45. ! open(OUT,">/dev/tty") || open(OUT, ">&STDOUT");    # so we don't dongle stdout
  46.   select(OUT);
  47.   $| = 1;                # for DB'OUT
  48.   select(STDOUT);
  49. --- 49,56 ----
  50.   # 
  51.   #
  52.   
  53. ! open(IN, "</dev/console") || open(IN,  "<&STDIN");    # so we don't dingle stdin
  54. ! open(OUT,">/dev/console") || open(OUT, ">&STDOUT");    # so we don't dongle stdout
  55.   select(OUT);
  56.   $| = 1;                # for DB'OUT
  57.   select(STDOUT);
  58. ***************
  59. *** 64,79 ****
  60.   $| = 1;                # for real STDOUT
  61.   $sub = '';
  62.   
  63. - # Is Perl being run from Emacs?
  64. - $emacs = $main'ARGV[$[] eq '-emacs';
  65. - shift(@main'ARGV) if $emacs;
  66.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  67. ! print OUT "\nLoading DB routines from $header\n";
  68. ! print OUT ("Emacs support ",
  69. !        $emacs ? "enabled" : "available",
  70. !        ".\n");
  71. ! print OUT "\nEnter h for help.\n\n";
  72.   
  73.   sub DB {
  74.       &save;
  75. --- 57,64 ----
  76.   $| = 1;                # for real STDOUT
  77.   $sub = '';
  78.   
  79.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  80. ! print OUT "\nLoading DB routines from $header\n\nEnter h for help.\n\n";
  81.   
  82.   sub DB {
  83.       &save;
  84. ***************
  85. *** 93,107 ****
  86.       }
  87.       }
  88.       if ($single || $trace || $signal) {
  89. !     if ($emacs) {
  90. !         print OUT "\032\032$filename:$line:0\n";
  91. !     } else {
  92. !         print OUT "$package'" unless $sub =~ /'/;
  93. !         print OUT "$sub($filename:$line):\t",$dbline[$line];
  94. !         for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  95. !         last if $dbline[$i] =~ /^\s*(}|#|\n)/;
  96. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  97. !         }
  98.       }
  99.       }
  100.       $evalarg = $action, &eval if $action;
  101. --- 78,88 ----
  102.       }
  103.       }
  104.       if ($single || $trace || $signal) {
  105. !     print OUT "$package'" unless $sub =~ /'/;
  106. !     print OUT "$sub($filename:$line):\t",$dbline[$line];
  107. !     for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  108. !         last if $dbline[$i] =~ /^\s*(;|}|#|\n)/;
  109. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  110.       }
  111.       }
  112.       $evalarg = $action, &eval if $action;
  113. ***************
  114. *** 263,276 ****
  115.               $i = $2;
  116.               $i = $line if $i eq '.';
  117.               $i = 1 if $i < 1;
  118. !             if ($emacs) {
  119. !             print OUT "\032\032$filename:$i:0\n";
  120. !             $i = $end;
  121. !             } else {
  122. !             for (; $i <= $end; $i++) {
  123. !                 print OUT "$i:\t", $dbline[$i];
  124. !                 last if $signal;
  125. !             }
  126.               }
  127.               $start = $i;    # remember in case they want more
  128.               $start = $max if $start > $max;
  129. --- 244,252 ----
  130.               $i = $2;
  131.               $i = $line if $i eq '.';
  132.               $i = 1 if $i < 1;
  133. !             for (; $i <= $end; $i++) {
  134. !             print OUT "$i:\t", $dbline[$i];
  135. !             last if $signal;
  136.               }
  137.               $start = $i;    # remember in case they want more
  138.               $start = $max if $start > $max;
  139. ***************
  140. *** 417,427 ****
  141.               $start = 1 if ($start > $max);
  142.               last if ($start == $end);
  143.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  144. !                 if ($emacs) {
  145. !                 print OUT "\032\032$filename:$start:0\n";
  146. !                 } else {
  147. !                 print OUT "$start:\t", $dbline[$start], "\n";
  148. !                 }
  149.                   last;
  150.               }
  151.               } ';
  152. --- 393,399 ----
  153.               $start = 1 if ($start > $max);
  154.               last if ($start == $end);
  155.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  156. !                 print OUT "$start:\t", $dbline[$start], "\n";
  157.                   last;
  158.               }
  159.               } ';
  160. ***************
  161. *** 445,455 ****
  162.               $start = $max if ($start <= 0);
  163.               last if ($start == $end);
  164.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  165. !                 if ($emacs) {
  166. !                 print OUT "\032\032$filename:$start:0\n";
  167. !                 } else {
  168. !                 print OUT "$start:\t", $dbline[$start], "\n";
  169. !                 }
  170.                   last;
  171.               }
  172.               } ';
  173. --- 417,423 ----
  174.               $start = $max if ($start <= 0);
  175.               last if ($start == $end);
  176.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  177. !                 print OUT "$start:\t", $dbline[$start], "\n";
  178.                   last;
  179.               }
  180.               } ';
  181.